<?php

/*
  Classe User
  Gestione degli utenti
 */
Class User {

    private $row;

    function __construct($row) {
        $this->row = $row;
    }

    function getAvatar() {
        //SI VA A PRENDERE DAL DB L'IMAGE CON QUESTO ID...
        return getAvatarPathByIdUser($this->getId());
    }

    function getId() {
        return $this->row['id'];
    }
    function getUsername() {
        return $this->row['username'];
    }
    function getGroup() {
        return $this->row['group_name'];
    }
    function getGroupDesc() {
        return $this->row['description'];
    }
    function isGraduated(){
        return $this->row['graduated'];
    }
    function doLogin() {
        //Carica
        $_SESSION['user'] = serialize($this);
        $_SESSION['login'] = true;
    }

    function getLastOperation() {
        return $this->row['time_last_operation'];
    }

}

?>